Telegram Group & Telegram Channel
Сравнение строк другими операторами

Для сравнения строк в Python используются не только == и !=. Как и при сравнении чисел, мы можем использовать операторы <, >, <= и >=.

Мы присваиваем значение «chinese» для string и «china» для string1. Теперь сравним эти две строки с помощью операторов сравнения <, >, <=, >=.

После сравнения string и string1 оператором < мы получаем False. Первые четыре символа «chinese» и «china» идентичны. Однако пятый символ переменной string – «е», в то время как пятый символ string1 – «а». Значение «e» в Юникоде равно 101, а «a» – 97. Таким образом, в результате сравнения этих переменных «chinese» оказывается больше, чем «china».

Подписывайтесь на канал 👉@pythonofff



tg-me.com/pythonofff/2951
Create:
Last Update:

Сравнение строк другими операторами

Для сравнения строк в Python используются не только == и !=. Как и при сравнении чисел, мы можем использовать операторы <, >, <= и >=.

Мы присваиваем значение «chinese» для string и «china» для string1. Теперь сравним эти две строки с помощью операторов сравнения <, >, <=, >=.

После сравнения string и string1 оператором < мы получаем False. Первые четыре символа «chinese» и «china» идентичны. Однако пятый символ переменной string – «е», в то время как пятый символ string1 – «а». Значение «e» в Юникоде равно 101, а «a» – 97. Таким образом, в результате сравнения этих переменных «chinese» оказывается больше, чем «china».

Подписывайтесь на канал 👉@pythonofff

BY Python академия




Share with your friend now:
tg-me.com/pythonofff/2951

View MORE
Open in Telegram


Python академия Telegram | DID YOU KNOW?

Date: |

Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

Python академия from cn


Telegram Python академия
FROM USA